package com.miplus.ccrm.core.service.aiqm;

import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.miplus.ccrm.core.controller.vo.aiqm.QmGradeResVo;
import com.miplus.ccrm.core.pojo.QmGrade;
import com.miplus.ccrm.core.mapper.QmGradeMapper;
import com.miplus.ccrm.core.pojo.QmRules;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author pc
* @description 针对表【QM_GRADE(质检项得分表)】的数据库操作Service实现
* @createDate 2024-12-03 20:15:36
*/
@Service
public class QmGradeServiceImpl extends MPJBaseServiceImpl<QmGradeMapper, QmGrade>
    implements QmGradeService{

    @Override
    public List<QmGradeResVo> getQmGradeItem(String dataid)
    {
        return selectJoinList(QmGradeResVo.class,
                new MPJLambdaWrapper<QmGrade>()
                        .selectAs(QmRules::getRname,QmGradeResVo::getOptionname)
                        .leftJoin(QmRules.class,"qr",QmRules::getRulesid,QmGrade::getOptionid)
                        .eq(QmGrade::getDataid,dataid)
                        .selectAll(QmGrade.class)
                        .orderByAsc(QmGrade::getOptionid)
        );
    }
}




